const { connection } = require('../../../model/database')
module.exports = (req, res) => {
    var sql = `insert into article (title,author,content,date,class) values('${req.body.title}','${req.body.author}','${req.body.content}','${req.body.date}','${req.body.class}')`

    connection.query(sql, async (error, reslut) => {
        if (error) {
            res.status(400).send({
                message: '发布失败',
            })
            return
        }
        res.status(200).send({
            message: '发布成功',
        })
    })
}